Source data: https://covidtracking.com/, which updates daily at 4 PM ET.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
---
title: "COVID Case Plots"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
source_code: embed
---
Source data: , which updates daily at 4 PM ET.
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE
)
library(tidyverse)
library(jsonlite)
library(lubridate)
library(httr)
library(scales)
library(plotly)
library(flexdashboard)
```
```{r importData, echo = FALSE}
COVID_states <- fromJSON("https://covidtracking.com/api/states/daily")
COVID_states$date <- ymd(COVID_states$date)
COVID_states <- COVID_states %>%
arrange(date)
COVID_US <- fromJSON("https://covidtracking.com/api/us/daily")
COVID_US$date <- ymd(COVID_US$date)
COVID_US <- COVID_US %>%
arrange(date)
```
```{r UScalcs, echo = FALSE}
COVID_US <- COVID_US %>%
mutate(dailyPositives = c(NA, diff(positive)))
# calculate 5-day averaged new cases
COVID_US <- COVID_US %>%
mutate(avgDailyPositives =
(lag(dailyPositives, n = 2) +
lag(dailyPositives, n = 1) +
dailyPositives +
lead(dailyPositives, n = 1) +
lead(dailyPositives, n = 2)) / 5)
# calculate growth rate from 5-day averaged new cases
COVID_US <- COVID_US %>%
mutate(growthRate = avgDailyPositives/lag(avgDailyPositives))
# calculate daily % change in average daily increase
COVID_US <- COVID_US %>%
mutate(percentChange = 100 * avgDailyPositives / positive)
```
US
=================================================
Row
---------------------------------------------------
### Cumulative Cases
```{r UStotal, echo=FALSE}
US_total_plot <- ggplot(COVID_US,
aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 10 * max(COVID_US$positive)),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
US_plotly_total <- ggplotly(p = (US_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
US_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r USdaily, echo=FALSE}
# average new daily cases
US_new_daily_plot <- ggplot(COVID_US,
aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 42000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
US_plotly_new_daily <- ggplotly(
p = (US_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
US_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r USdailyGrowth, echo=FALSE}
US_growth_rate_plot <- ggplot(COVID_US,
aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, round(1.5* max(COVID_US$growthRate,
na.rm = TRUE),
digits = 0), by = 0.5),
limits = c(0, 1.5 * max(COVID_US$growthRate,
na.rm = TRUE)),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
US_growth_plotly <- ggplotly(
p = (US_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
US_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r USpercentChange, echo=FALSE}
# average daily percent change
US_daily_percent <- COVID_US %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
USpercentPlot <- ggplotly(
p = (
US_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
USpercentPlot
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
```{r stateDataCalcs, message=FALSE, warning=FALSE, include=FALSE}
# calculate daily increase of positive cases, averaged daily increase, and averaged daily growth rate by state
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(dailyPositives = c(NA, diff(positive)))
# calculate 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(avgDailyPositives =
(lag(dailyPositives, n = 2) +
lag(dailyPositives, n = 1) +
dailyPositives +
lead(dailyPositives, n = 1) +
lead(dailyPositives, n = 2)) / 5)
# calculate growth rate from 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(growthRate = avgDailyPositives/lag(avgDailyPositives))
# calculate percent change in 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(percentChange = 100 * avgDailyPositives / positive)
```
WI
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r WItotal, echo=FALSE}
WI_total_plot <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
WI_plotly_total <- ggplotly(p = (WI_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
WI_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r WIdaily, echo=FALSE}
# average new daily cases
WI_new_daily_plot <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 300),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
WI_plotly_new_daily <- ggplotly(
p = (WI_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WI_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r WIdailyGrowth, echo=FALSE}
WI_growth_rate_plot <- COVID_states %>%
filter(state %in% "WI") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 3.0, by = 0.5),
limits = c(0, 3.1),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
WI_growth_plotly <- ggplotly(
p = (WI_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
WI_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r WIpercentChange, echo=FALSE}
# average daily percent change
WI_daily_percent <- COVID_states %>%
filter(state %in% "WI") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
WIpercentPlotly <- ggplotly(
p = (
WI_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WIpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
MN
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r MNtotal, echo=FALSE}
MN_total_plot <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
MN_plotly_total <- ggplotly(p = (MN_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MN_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r MNdaily, echo=FALSE}
# average new daily cases
MN_new_daily_plot <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 250),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
MN_plotly_new_daily <- ggplotly(
p = (MN_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MN_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r MNdailyGrowth, echo=FALSE}
MN_growth_rate_plot <- COVID_states %>%
filter(state %in% "MN") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
MN_growth_plotly <- ggplotly(
p = (MN_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MN_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r MNpercentChange, echo=FALSE}
# average daily percent change
MN_daily_percent <- COVID_states %>%
filter(state %in% "MN") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
MNpercentPlotly <- ggplotly(
p = (
MN_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MNpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
AL
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r ALtotal, echo=FALSE}
AL_total_plot <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
AL_plotly_total <- ggplotly(p = (AL_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
AL_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r ALdaily, echo=FALSE}
# average new daily cases
AL_new_daily_plot <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 330),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
AL_plotly_new_daily <- ggplotly(
p = (AL_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
AL_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r ALdailyGrowth, echo=FALSE}
AL_growth_rate_plot <- COVID_states %>%
filter(state %in% "AL") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
AL_growth_plotly <- ggplotly(
p = (AL_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
AL_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r ALpercentChange, echo=FALSE}
# average daily percent change
AL_daily_percent <- COVID_states %>%
filter(state %in% "AL") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
ALpercentPlotly <- ggplotly(
p = (
AL_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
ALpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
GA
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r GAtotal, echo=FALSE}
GA_total_plot <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 120000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
GA_plotly_total <- ggplotly(p = (GA_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
GA_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r GAdaily, echo=FALSE}
# average new daily cases
GA_new_daily_plot <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 1500),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
GA_plotly_new_daily <- ggplotly(
p = (GA_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GA_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r GAdailyGrowth, echo=FALSE}
GA_growth_rate_plot <- COVID_states %>%
filter(state %in% "GA") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
GA_growth_plotly <- ggplotly(
p = (GA_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
GA_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r GApercentChange, echo=FALSE}
# average daily percent change
GA_daily_percent <- COVID_states %>%
filter(state %in% "GA") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
GApercentPlotly <- ggplotly(
p = (
GA_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GApercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
FL
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r FLtotal, echo=FALSE}
FL_total_plot <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 110000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
FL_plotly_total <- ggplotly(p = (FL_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
FL_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r FLdaily, echo=FALSE}
# average new daily cases
FL_new_daily_plot <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 2000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
FL_plotly_new_daily <- ggplotly(
p = (FL_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FL_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r FLdailyGrowth, echo=FALSE}
FL_growth_rate_plot <- COVID_states %>%
filter(state %in% "FL") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
FL_growth_plotly <- ggplotly(
p = (FL_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
FL_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r FLpercentChange, echo=FALSE}
# average daily percent change
FL_daily_percent <- COVID_states %>%
filter(state %in% "FL") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
FLpercentPlotly <- ggplotly(
p = (
FL_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FLpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
MA
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r MAtotal, echo=FALSE}
MA_total_plot <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 200000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
MA_plotly_total <- ggplotly(p = (MA_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MA_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r MAdaily, echo=FALSE}
# average new daily cases
MA_new_daily_plot <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 2500),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
MA_plotly_new_daily <- ggplotly(
p = (MA_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MA_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r MAdailyGrowth, echo=FALSE}
MA_growth_rate_plot <- COVID_states %>%
filter(state %in% "MA") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
MA_growth_plotly <- ggplotly(
p = (MA_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MA_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in New Cases
```{r MApercentChange, echo=FALSE}
# average daily percent change
MA_daily_percent <- COVID_states %>%
filter(state %in% "MA") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
MApercentPlotly <- ggplotly(
p = (
MA_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MApercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
NY
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r NYtotal, echo=FALSE}
NY_total_plot <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 1100000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
NY_plotly_total <- ggplotly(p = (NY_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NY_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r NYdaily, echo=FALSE}
# average new daily cases
NY_new_daily_plot <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 15000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
NY_plotly_new_daily <- ggplotly(
p = (NY_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NY_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r NYdailyGrowth, echo=FALSE}
NY_growth_rate_plot <- COVID_states %>%
filter(state %in% "NY") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
NY_growth_plotly <- ggplotly(
p = (NY_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NY_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r NYpercentChange, echo=FALSE}
# average daily percent change
NY_daily_percent <- COVID_states %>%
filter(state %in% "NY") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
NYpercentPlotly <- ggplotly(
p = (
NY_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NYpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
NJ
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r NJtotal, echo=FALSE}
NJ_total_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 200000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
NJ_plotly_total <- ggplotly(p = (NJ_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NJ_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r NJdaily, echo=FALSE}
# average new daily cases
NJ_new_daily_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma,
limits = c(0, 5300),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
NJ_plotly_new_daily <- ggplotly(
p = (NJ_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJ_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r NJdailyGrowth, echo=FALSE}
NJ_growth_rate_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
geom_point(fill = "gray25", size = rel(2)) +
scale_x_date(date_breaks = "1 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
NJ_growth_plotly <- ggplotly(
p = (NJ_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NJ_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r NJpercentChange, echo=FALSE}
# average daily percent change
NJ_daily_percent <- COVID_states %>%
filter(state %in% "NJ") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_col(color = "black", fill = "gray50") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "1 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
NJpercentPlotly <- ggplotly(
p = (
NJ_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.